import axios from '@/libs/axios1'
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' }
let base = '/testplatform/testBug'
// 创建bug
export const addBug = data => {
    return axios({
        url: `/testplatform/testBug`,
        method: 'POST',
        data,
        headers: jsonHeaders,
    })
}

// 修改bug
export const updateBug = data => {
    return axios({
        url: `/testplatform/testBug`,
        method: 'PUT',
        data,
        headers: jsonHeaders,
    })
}
export const queryProductPartList = params => {
    return axios({
        url: `/testplatform/productPart/page`,
        method: 'GET',
        params,
        headers: jsonHeaders,
    })
}
export const templateUrl = (params) => {
    return axios({
      ///testplatform//resources/downExcel
      url: `/testplatform/resources/downExcel`,
      method: 'GET',
      responseType: 'blob',
      params,
      headers: jsonHeaders,
    })
  }
// 查询网络资产服务列表
export const queryAssetServiceList = params => {
    return axios({
        url: `/testplatform/asset/serviceInfo/page`,
        method: 'GET',
        params,
        headers: jsonHeaders,
    })
}
// 查询网络资产列表
export const queryAssetList = params => {
    return axios({
        url: `/testplatform/asset/page`,
        method: 'GET',
        params,
        headers: jsonHeaders,
    })
}
// 根据资产查询软件、固件、服务下的产品
export const getProductByAsset = params => {
    return axios({
        url: `/testplatform/testTwoRestart/getAssetQueryProduct`,
        method: 'GET',
        params,
        headers: jsonHeaders
    })
}

// 创建漏洞
export const saveCreateVulnerability = data => {
    return axios({
        url: `/testplatform/testTwoRestart/saveCreateVulnerability`,
        method: 'POST',
        data,
        headers: jsonHeaders
    })
}

// 修改漏洞
export const updCreateVulnerability = data => {
    return axios({
        url: `/testplatform/testTwoRestart/updCreateVulnerability`,
        method: 'PUT',
        data,
        headers: jsonHeaders
    })
}
